package org.bookie.model.services;

import org.bookie.model.User;
import org.bookie.model.services.impl.GenericDAO;

public interface UserDAO extends GenericDAO<User, Long> {

	/**
	 * Returns user with given email
	 * @param email
	 * @return
	 */
	public User findByEmail(String email);
	
	/**
	 * Returns user with given userName
	 * @param userName
	 * @return
	 */
	public User findByUserName(String userName);
	

	/**
	 * Activates user
	 * @param key
	 * @return
	 */
	public boolean activate(String key);
	
	/**
	 * Re-read the state of the given user from the underlying database.
	 * @param user user to refresh
	 */
	public void refresh(User user);

}
